//
//  KSMacro.swift
//  Supermarket
//
//  Created by liuxm on 2017/8/8.
//  Copyright © 2017年 kushao. All rights reserved.
//

import UIKit

class KSMacro: NSObject {
    // 颜色RGB
    static func ColorByRGB(r:CGFloat, _ g:CGFloat, _ b:CGFloat) -> UIColor {
        return UIColor(red: (r)/255.0, green: (g)/255.0, blue: (b)/255.0, alpha: 1.0)
    }
    // 字体大小
    static func FontBySize(size:CGFloat) -> UIFont {
        return UIFont.systemFont(ofSize: size)
    }
}

/// 常量
class KSConstants: NSObject {
    // 获取屏幕的高
    static let kScreenHeight = UIScreen.main.bounds.height
    // 获取屏幕的宽
    static let kScreenWidth = UIScreen.main.bounds.width
    // Window
    static let kWindow = UIApplication.shared.keyWindow
}

/// 颜色
class KSColor: NSObject {
    /// 黑色
    static let kColorBlack = UIColor.colorWithHexString(hex: "#000000")
    /// 白色
    static let kColorWhite = UIColor.colorWithHexString(hex: "#ffffff")
    /// 主标题黑色
    static let kColor_3 = UIColor.colorWithHexString(hex: "#333333")
    /// 子标题黑色
    static let kColor_9 = UIColor.colorWithHexString(hex: "#999999")
    /// 线条颜色
    static let kColor_line = UIColor.colorWithHexString(hex: "#e6e6e6")
    /// 主红色
    static let kColorMainRed = UIColor.colorWithHexString(hex: "#dd2727")
    /// 按钮失效的颜色
    static let kColorButtonDisabled = UIColor.colorWithHexString(hex: "#eeeeee")
    /// 按钮高亮颜色
    static let kColorButtonHighlight = UIColor.colorWithHexString(hex: "#b7010f")
    /// 按钮选中的颜色
    static let kColorButtonSelected = UIColor.colorWithHexString(hex: "#dd2727")
    /// 背景色
    static let kColorViewBackground = UIColor.colorWithHexString(hex: "#f4f5f7")
    /// 浅灰色背景
    static let kColorLightGray = UIColor.colorWithHexString(hex: "#f9fafb")
}

